<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  let date = new Date();//Sat Aug 21 2021 15:16:13 GMT+0800 (中国标准时间)
  date.getFullYear();
  date.getMonth();
  date.getDate();//日
  date.getDay();//星期几
  date.getHours();
  date.getMinutes();
  date.getSeconds();
  date.getTime();//1629530173920  时间戳

  console.log(new Date(1629530173920));

  console.log(date.toLocaleString());

  console.log(date.toISOString());

</script>
</body>
</html>